<template>
  <Pagination
    :page="page"
    @pagingChange="handlePageChange"
    @data-prev="dataPrev"
    @data-next="dataNext"
    @size-change="handleSizeChange"
  />
</template>

<script setup lang="ts">
import { Page } from '@/components/Pagination.vue'

const page = ref<Page>({
  limit: 10,
  count: 182,
  current: 1
})

const handlePageChange = (cur: number) => {
  page.value.current = cur
}

const handleSizeChange = (cur: number) => {
  page.value.limit = cur
}

const dataPrev = () => {
  page.value.current -= 1
}

const dataNext = () => {
  page.value.current += 1
}
</script>

<style scoped lang="scss"></style>
